home *** CD-ROM | disk | FTP | other *** search
File List | 1989-12-06 | 7.8 KB | 340 lines |
- '
- ' Slide Show program by Heidi Brumbaugh
- ' Copyright 1990 Antic Publishing
- ' Uses wipes and dissolves routines by Carlos R. Tirado O.
- '
- Dim S%(5),D%(5),P%(8)
- Rez%=Xbios(4)
- Screen=Xbios(2)
- S1$=Space$(32256)
- Scrn1=(Int(Varptr(S1$)/256)+1)*256 ! Buffer used by wipe/dissolve routines
- S2$=Space$(32256)
- Scrn2=(Int(Varptr(S2$)/256)+1)*256 ! Used only in Rollup routine
- If Rez%=1 ! Don't use medium rez% (but this program would work if we did)
- Void Xbios(5,L:-1,L:-1,W:0)
- Cur_res%=0
- Else
- Cur_res%=Rez%
- Endif
- Pct_res%=Cur_res%
- N_eff%=11
- N_pics%=4
- @Save_pal
- Palet$=Space$(32)
- Effect%=1
- Delay%=1
- Hidem
- Shown!=False
- Cls
- '
- Do
- Restore
- For I%=1 To N_pics%
- Read Nam$
- Nam$=Nam$+".pi"+Str$(Cur_res%+1)
- If Not Exist(Nam$)
- ' Skip it if file isn't there, but keep track so if no files are there
- ' we can get out.
- Inc Missing%
- If Missing%>=N_pics% And Not Shown!
- If Rez%<>Cur_res%
- Void Xbios(5,L:-1,L:-1,W:Rez%)
- Cur_res%=Rez%
- Endif
- Alert 3,"Can't do slideshow -- | pics are missing.",1,"Abort",D
- @Done
- Endif
- Else
- Shown!=True
- If Effect%>N_eff%
- Effect%=1
- Endif
- @Degasload
- Pause Delay%
- @Colorit
- On Effect% Gosub Rollup,Rolldown,Scroll,Uncover,Cover,Venetian,Iris,Rndom,Cross,Assemble,Square
- Inc Effect%
- Endif
- If Inkey$<>""
- @Done
- Endif
- Next I%
- Loop
- '
- @Done
- Data pic_1,pic_2,pic_3,pic_4
- '
- Procedure Done
- If Rez%<>Cur_res%
- Void Xbios(5,L:-1,L:-1,W:Rez%)
- Endif
- @Restore_pal
- End
- Return
- '
- Procedure Degasload
- Open "I",#1,Nam$
- Seek #1,2
- Bget #1,Varptr(Palet$),32
- Bget #1,Scrn1,32000
- Close #1
- Return
- '
- Procedure Colorit
- Local I%
- For I%=0 To 15
- Setcolor I%,Dpeek(Varptr(Palet$)+I%*2)
- Next I%
- Return
- '
- '
- ' ------------- SAVE ORIGINAL COLOR PALETTE -----------------------
- Procedure Save_pal
- '
- Dim Spalette%(16,3)
- '
- For Z%=0 To 15
- Dpoke Contrl,26
- Dpoke Contrl+2,0
- Dpoke Contrl+6,2
- Dpoke Intin,Z%
- Dpoke Intin+2,0
- Vdisys
- Spalette%(Z%,0)=Dpeek(Intout+2)
- Spalette%(Z%,1)=Dpeek(Intout+4)
- Spalette%(Z%,2)=Dpeek(Intout+6)
- Next Z%
- Return
- '
- Procedure Restore_pal
- ' --------------------- RESTORES PALETTE -------------------
- ' Dimensions: Spalette%(16,3)
- '
- For Z%=0 To 15
- Dpoke Contrl,14
- Dpoke Contrl+2,0
- Dpoke Contrl+6,4
- Dpoke Intin,Z%
- Dpoke Intin+2,Spalette%(Z%,0)
- Dpoke Intin+4,Spalette%(Z%,1)
- Dpoke Intin+6,Spalette%(Z%,2)
- Vdisys
- Next Z%
- Return
- '
- ' ======================================================================
- ' GFA-BASIC Video Effects Routines
- ' ======================================================================
- ' ------------------------------
- ' BMOVE ROUTINES (Wipes)
- ' ------------------------------
- '
- ' This next subroutine "rollup" is not included in the Slide Show
- ' program SUSLSHOW.BAS If you intend to use it please note that
- ' it uses an additional 32000 bytes accessed by the pointer -scrn2-
- '
- Procedure Rollup
- Bmove Screen,Scrn2,32000
- For Ev=1 To 50
- Bmove Screen+32000-160*(Ev+Ev-1),Screen+32000-160*(Ev+Ev+1),Ev*160
- Bmove Scrn2+32000-160*(Ev+1),Screen+32000-160*(Ev+1),160
- Bmove Scrn1+32000-160*Ev,Screen+32000-160*Ev,160
- Next Ev
- For Ev=98 Downto 0
- Bmove Screen+160*Ev+320,Screen+160*Ev,7840
- Bmove Scrn2+160*Ev+8160,Screen+160*Ev+7840,160
- Bmove Scrn1+160*Ev+8000,Screen+160*Ev+8000,320
- Next Ev
- For Ev=7840 To 160 Step -160
- Bmove Screen+320,Screen,Ev
- Bmove Scrn2+Ev-160,Screen+Ev-160,160
- Bmove Scrn1+Ev,Screen+Ev,160
- Next Ev
- Bmove Scrn1,Screen,160
- Return
- '
- Procedure Rolldown
- For Ev=1 To 49
- Bmove Screen,Screen+320,160*Ev
- Bmove Scrn1+160*(Ev+Ev+1),Screen+160,160
- Bmove Scrn1+160*(Ev+Ev+2),Screen,160
- Next Ev
- For Ev=0 To 98
- Bmove Screen+160*Ev,Screen+160*Ev+320,7840
- Bmove Scrn1+160*Ev,Screen+160*Ev,160
- Bmove Scrn1+160*Ev+16160,Screen+160*Ev+160,160
- Next Ev
- For Ev=50 Downto 1
- Bmove Screen+32000-160*(Ev+Ev+1),Screen+32000-160*(Ev+Ev-1),Ev*160
- Bmove Scrn1+32000-160*(Ev+Ev+1),Screen+32000-160*(Ev+Ev+1),320
- Next Ev
- Return
- '
- Procedure Scroll
- For Ev=0 To 31680 Step 320
- Bmove Screen+320,Screen,31680
- Bmove Scrn1+Ev,Screen+31680,320
- Next Ev
- Return
- '
- Procedure Uncover
- For Ev=0 To 15840 Step 160
- Bmove Screen+160,Screen,15840
- Bmove Scrn1+Ev,Screen+15840,160
- Bmove Screen+16000,Screen+16160,15840
- Bmove Scrn1+31840-Ev,Screen+16000,160
- Next Ev
- Return
- '
- Procedure Cover
- For Ev=15840 To 0 Step -160
- Bmove Scrn1+Ev,Screen,16000-Ev
- Bmove Scrn1+16000,Screen+16000+Ev,16000-Ev
- Next Ev
- Return
- '
- Procedure Venetian
- Local Ev,Ev2
- For Ev=0 To 7840 Step 160
- For Ev2=0 To 24000 Step 8000
- Bmove Scrn1+8000-Ev-160+Ev2,Screen+Ev2,Ev+160
- Next Ev2
- Next Ev
- Return
- ' ----------------------------------
- ' BIT BLIT ROUTINES (Dissolves)
- ' ----------------------------------
- '
- ' Don't forget to include in your program the next line:
- ' DIM s%(5),d%(5),p%(8)
- '
- Procedure Setup_bitblit
- P%(0)=0 ! p%() coordinates & mode of Bit Blit
- P%(8)=3
- S%(0)=Scrn1 ! s%() contains SFMDB
- S%(1)=320-320*(Pct_res%<>0)
- S%(2)=200-200*(Pct_res%=2)
- S%(3)=Int((S%(1)+15)/16)
- S%(4)=0
- S%(5)=4-2*(Pct_res%)-(Pct_res%=2)
- D%(0)=Screen ! d%() contains DFMDB
- D%(1)=S%(1)
- D%(2)=S%(2)
- D%(3)=S%(3)
- D%(4)=0
- D%(5)=S%(5)
- Return
- '
- Procedure Iris
- @Setup_bitblit
- For Ev=1 To 39
- P%(0)=S%(1)/2-Ev*S%(1)/80
- P%(4)=P%(0)
- P%(1)=S%(2)/2-Ev*S%(2)/80
- P%(5)=P%(1)
- P%(2)=S%(1)/2+Ev*S%(1)/80-1
- P%(6)=P%(2)
- P%(3)=S%(2)/2+Ev*S%(2)/80-1
- P%(7)=P%(3)
- Bitblt S%(),D%(),P%()
- Next Ev
- Bmove Scrn1,Screen,32000
- Return
- '
- Procedure Rndom
- @Setup_bitblit
- Local A$
- A$=Space$(400)
- For Ev=0 To 399
- Dpoke Varptr(A$)+Ev*2,Ev
- Next Ev
- For Ev=399 Downto 0
- R=Random(Ev)
- Ev2=Dpeek(Varptr(A$)+R*2)
- P%(0)=(Ev2 Mod 20)*Int(S%(1)/20)
- P%(1)=Int(Ev2/20)*Int(S%(2)/20)
- P%(2)=P%(0)+Int(S%(1)/20)
- P%(3)=P%(1)+Int(S%(2)/20)
- P%(4)=P%(0)
- P%(5)=P%(1)
- P%(6)=P%(2)
- P%(7)=P%(3)
- Dpoke Varptr(A$)+R*2,Dpeek(Varptr(A$)+Ev*2)
- Bitblt S%(),D%(),P%()
- Next Ev
- Clr A$
- Return
- '
- Procedure Cross
- @Setup_bitblit
- For Ev=1 To 20
- P%(0)=0
- P%(1)=0
- P%(2)=Ev*S%(1)/40-1
- P%(3)=Ev*S%(2)/40
- P%(4)=P%(0)
- P%(5)=P%(1)
- P%(6)=P%(2)
- P%(7)=P%(3)
- Bitblt S%(),D%(),P%()
- P%(1)=S%(2)-P%(3)
- P%(3)=S%(2)-1
- P%(4)=P%(0)
- P%(5)=P%(1)
- P%(6)=P%(2)
- P%(7)=P%(3)
- Bitblt S%(),D%(),P%()
- P%(0)=S%(1)-P%(2)-1
- P%(2)=S%(1)-1
- P%(4)=P%(0)
- P%(5)=P%(1)
- P%(6)=P%(2)
- P%(7)=P%(3)
- Bitblt S%(),D%(),P%()
- P%(1)=0
- P%(3)=Ev*S%(2)/40
- P%(4)=P%(0)
- P%(5)=P%(1)
- P%(6)=P%(2)
- P%(7)=P%(3)
- Bitblt S%(),D%(),P%()
- Next Ev
- Return
- '
- Procedure Assemble
- @Setup_bitblit
- For Ev=0 To 39
- For Ev2=0 To 7
- P%(1)=Ev2*S%(2)/8
- P%(3)=P%(1)+S%(2)/8
- If Even(Ev2)
- P%(0)=Ev*S%(1)/40
- Else
- P%(0)=S%(1)-Ev*S%(1)/40-S%(1)/40
- Endif
- P%(2)=P%(0)+S%(1)/40-1
- P%(4)=P%(0)
- P%(5)=P%(1)
- P%(6)=P%(2)
- P%(7)=P%(3)
- Bitblt S%(),D%(),P%()
- Next Ev2
- Next Ev
- Return
- '
- Procedure Square
- @Setup_bitblit
- For Ev=0 To 99
- Ev2=Ev*2-Odd(Int(Ev*2/10))+99*(Ev>49)+2*(Odd(Int(Ev*2/10)) And Ev>49)
- P%(0)=(Ev2 Mod 10)*Int(S%(1)/10)
- P%(1)=Int(Ev2/10)*Int(S%(2)/10)
- P%(2)=P%(0)+Int(S%(1)/10)
- P%(3)=P%(1)+Int(S%(2)/10)
- P%(4)=P%(0)
- P%(5)=P%(1)
- P%(6)=P%(2)
- P%(7)=P%(3)
- Bitblt S%(),D%(),P%()
- Next Ev
- Return
-